#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5+10;
int a[maxn],n;
int h[maxn];
int min_=0x7f7f7f7f;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    scanf("%d",&n);
    for(int i=1;i<=n;i++){ scanf("%d",&a[i]); min_=min(min_,a[i]);h[a[i]]++;}
    sort(a+1,a+n+1);
    int k=1;
    while(a[k]==min_){
        k++;
    }
    int ans=0;
    int left=1;
    for(int i=k;i<=n;i++){
        int num=left;//lower_bound(a+1,a+n+1,a[i])-a;
        if(h[a[num]]>0&&a[i]>a[num]){ h[a[num]]--;ans++;left++;}
    }
    cout<<n-ans<<endl;
    return 0;
}
/*
10
136 136 136 2417 136 136 2417 136 136 136
*/
